# Pin a group

Pins a group to the user's pinned list with an optional order number. The user must be a member of the group. If no pin number is provided, the next available number is assigned automatically. Authentication is required.

Endpoint: PUT /api/v1/groups/{groupId}/pin
Version: 1.0
Security: header

## Query parameters:

  - `pin` (integer,null)
    Pin order number. If not provided, next available number will be used
    Example: 1

## Path parameters:

  - `groupId` (string, required)
    The unique identifier of the group
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

## Response 200 fields (application/json):

  - `userId` (string, required)
    ID of the user who pinned the group
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

  - `groupId` (string, required)
    ID of the pinned group
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

  - `pin` (integer, required)
    Pin order number (positive integer for sorting)

  - `createdAt` (string, required)
    When the group was pinned
    Example: "2022-03-10T12:15:50"

  - `updatedAt` (string, required)
    When the pin was last updated
    Example: "2022-03-10T12:15:50"

## Response 401 fields (application/json):

  - `errorCode` (string, required)
    Error code

  - `message` (string, required)
    Error message

  - `docUrl` (string)
    Link to documentation

## Response 403 fields (application/json):

  - `errorCode` (string, required)
    Error code

  - `message` (string, required)
    Error message

  - `docUrl` (string)
    Link to documentation

## Response 404 fields (application/json):

  - `errorCode` (string, required)
    Error code

  - `message` (string, required)
    Error message

  - `docUrl` (string)
    Link to documentation


